package com.kb.config;

import com.kb.controller.interceptor.LoginrequiredInterceptor;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import javax.annotation.Resource;

@Component
public class WebMvcConfig implements WebMvcConfigurer {

    @Resource
    private LoginrequiredInterceptor loginrequiredInterceptor;


    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(loginrequiredInterceptor)
                .excludePathPatterns("/login/toLogin")
                .addPathPatterns("/**");
    }

}
